<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>列表</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}"></link>
</head>
<body class="container">
<br/>
<h1>用户列表</h1>
<br/><br/>
<form th:action="@{/search}" method="post">
    <div class="form-group">
        <div class="col-sm-10">
            <input type="text" class="form-control" name="name" style="width: 200px;display: inline"    placeholder="name"/>
            <input type="submit" value="查找" class="btn btn-info" />
        </div>
    </div>

</form>
<div class="with:80%">
    <table class="table table-hover">
        <thead>
        <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Phone</th>
            <th>Edit</th>
            <th>Delete</th>
        </tr>
        </thead>
        <tbody>
        <tr  th:each="user : ${userList}">
            <th scope="row" th:text="${user.id}">1</th>
            <td th:text="${user.name}">neo</td>
            <td th:text="${user.phone}">Otto</td>
            <td><a th:href="@{/toEdit(id=${user.id})}">edit</a></td>
            <td><a th:href="@{/delete(id=${user.id})}"  onclick="return confirm('确定要删除吗?')">delete</a></td>
        </tr>
        </tbody>
    </table>
</div>
<div class="form-group">
    <div class="col-sm-2 control-label">
        <a href="/toAdd" th:href="@{/toAdd}" class="btn btn-info">add</a>
    </div>
</div>

</body>
</html>